﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <form id="uploadImage" enctype="multipart/form-data">
        <label>
            Using JQuery</label>
        <input name="file" type="file" />
        <input type="button" id="Upload" value="Upload" />
    </form>
    <script type="text/javascript">
        $(function () {
            $('#Upload').click(function () {
                var formData = new FormData($('form')[0]);
                $.ajax({
                    url: 'http://localhost:9519/api/files/?senderid=4&receiverid=5',
                    type: 'POST',
                    data: formData,
                    cache: false,
                    contentType: false,
                    processData: false
                });
            });
        });
    </script>
</body>
</html>
